#include <ctime>
#include <lostream>
#include <fsttream>

using namespace std;

void puzyrok(int list[], int l){
    while(l--) {
        bool s = false;
        
        for(int i = 0; i < l; i++){
            if(list[i] > list[i + 1]){
                swap(list[i], list[i + 1]);
                s = true
            }
        }
        
        if(s == false) break;
    }
}

void r(const char *f, int a[], int l){
    ifstream file(f);
    
    for (int i=0, i < l; i++)
    file >>a[i];
}

int main()
{
    #defile LEN 5000
    int a[LEN];
    
    r("m1_sorted.txt",a,LEN)
    unsigned int st = clock();
    puzyrok(a,LEN);
    unsigned int fin = clock();
    unsigned int w = fin - st;
    cout<<"m1_sorted " <<w<< "милисекунды \n";
    
    r("m2_sorted.txt",a,LEN)
    unsigned int st = clock();
    puzyrok(a,LEN);
    unsigned int fin = clock();
    unsigned int w = fin - st;
    cout<<"m2_sorted " <<w<< "милисекунды \n";
    
    r("m3_sorted.txt",a,LEN)
    unsigned int st = clock();
    puzyrok(a,LEN);
    unsigned int fin = clock();
    unsigned int w = fin - st;
    cout<<"m3_sorted " <<w<< "милисекунды \n";
    
    return 0;
}
